<include file="Public:head" />
<style>

    .table-striped tr  .td_dan{
        line-height: 30px;text-align: right;width: 50px
    }
    .width20{
        width: 260px;
    }
    .img{
        width: 100px;
        line-height: 34px;
        background-color: #cccccc;
        text-align: center;
        cursor: pointer;
        border-radius: 3px;
        font-size: 14px;
        display:inline-block;
    }
    .img_hide{
        position: relative;
        top: 10px;
        z-index:10;
        width: 100px;
        height: 34px;
        opacity: 0;
        cursor: pointer;
    }
</style>
<body class="overflow-hidden">
<div class="wrapper preload">
    <include file="Public:header" />
    <include file="Public:left" />
    <div class="main-container">
        <div class="padding-md">
            <div class="row">
                <div class="col-sm-12">
                    <div class="page-title">
                        {$info['id']?'编辑':'添加'}链接
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="smart-widget widget-green">
                        <form action="{:U('Hpage/friend_menu')}" method="post" enctype="multipart/form-data"class="form-admin" >
                            <table class="table table-striped no-margin" >
                                <tr >
                                    <td  style="width: 10%;text-align: right;line-height: 34px">学校名称</td>
                                    <td >
                                        <input type="text" class="form-control width20" name="school" value="{$info.school}">
                                        <span style="line-height: 34px">（学校名称）</span>
                                    </td>
                                </tr>
                                <tr >
                                    <td  style="width: 10%;text-align: right;line-height: 34px">链接地址</td>
                                    <td >
                                        <input type="text" class="form-control width20" name="url" value="{$info.url}">
                                        <span style="line-height: 34px">（学校链接地址:http://www.baidu.com）</span>
                                    </td>
                                </tr>
                                <tr >
                                    <td  style="width: 10%;text-align: right;line-height: 34px">排序</td>
                                    <td >
                                        <input type="text" class="form-control width20" name="sort" value="{$info.sort}" onkeyup="this.value=this.value.replace(/\D/gi,'')">
                                        <span style="line-height: 34px">（正整数数字小靠前）</span>
                                    </td>
                                </tr>
                                <tr >
                                    <td  style="width: 10%;text-align: right;line-height: 34px">首页是否显示</td>
                                    <td >
                                        <span style="line-height: 34px">
                                            <input type="radio" name="state" value="1" {$info['state']==1?'checked':''} checked>是
                                            <input type="radio" name="state" value="2" {$info['state']==2?'checked':''}>否
                                        </span>
                                    </td>
                                </tr>
                                <tr >
                                    <td  style="width: 10%;text-align: right;line-height: 34px" >上传图片</td>
                                    <td >
                                        <input type='button' class='form-control 'style="width: 100px;display:inline-block;" value='选择文件'  />
                                        <empty name="info['id']">
                                            <input type="file"  onchange="ajaxFileUpload('icoA',1);"  id="icoA" name="icoA" class="file_1" style="width: 100px;height: 34px;opacity: 0;position: relative;top: -34px;">
                                        <else />
                                            <input type="file"  onchange="ajaxFileUpload('icoA',1,1);"  id="icoA" name="icoA" class="file_1" style="width: 100px;height: 34px;opacity: 0;position: relative;top: -34px;">
                                        </empty>
                                        <div class="main_chaxin_1_2-8">
                                            <span class="span1" style="color:red;font-size: 12px;"> (目前只支持后缀名为 jpg , png , jpeg , bmp 格式)</span>
                                            <div id="show_upload_message_icoA" class="span1">
                                                <foreach name="upload_ids_arr" item="vo" >
                                                    <if condition="$vo neq ''">
                                                        <div id="file_id_{$vo}">
                                                            <a style="color:blue;" target="_blank" href="{:U('down_file')}?file_id={$vo}">查看图片</a>
                                                            &nbsp;&nbsp;&nbsp;&nbsp;
                                                            <a style="color:blue;" href="javascript:del_file('{$vo}','icoA')">删除</a>
                                                        </div>
                                                    </if>
                                                </foreach>
                                            </div>

                                        </div>
                                    </td>
                                </tr>
                                <tr class="result_list">
                                    <td>&nbsp;</td>
                                    <td>
                                        <input type="hidden" name="id" value="{$info.id}">
                                        <input type="hidden" name="upload_ids" id="upload_icoA" value="{$info.img}" class="file_1"/>
                                        <input class="action-button ajax-post" target-form="form-admin"  type="submit" value="保存">
                                        <button class="action-button" type="button" onclick="javascript:history.back(-1);return false;">返回</button>
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </div><!-- ./smart-widget -->
                </div><!-- ./col -->
            </div><!-- ./row -->
        </div><!-- ./padding-md -->
    </div><!-- /main-container -->
    <include file="Public:foot" />
</div><!-- /wrapper -->
<!--<include file="Public/base_fc" />-->
<a href="#" class="scroll-to-top hidden-print"><i class="fa fa-chevron-up fa-lg"></i></a>
</body>
</html>
<block name="script">
    <script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
    <script>
        $(function(){
            highlight_nav2('{:U("Hpage/friend")}');
        })
    </script>
</block>

<!--上传附件弹窗-->
<div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close"
                        data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    上传图片
                </h4>
            </div>
            <div class="modal-body">
                <div  id="xzwj">
                    <!--<input type='text' name='textfield' id='textfield' class="form-control_1" readonly="readonly"  style="margin-left: 0px" />-->

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal" style="background: none">关闭
                </button>
            </div>
        </div>
    </div>
</div>
